From 905fe781d17cb2e7405fd341b5ae1eba9c318596 Mon Sep 17 00:00:00 2001 From: Ian Off Date: Wed, 20 Aug 2025 23:27:43 -0500 Subject: [PATCH] screenshot: End screencast with same keybinding as start screencast Currently, the screencast keyboard shortcut shows the UI to begin a screencast, but there is no way to end it with a keyboard shortcut. This behavior is inconvenient and seems to be a regression, as a wide variety of online resources recommend using the same shortcut to start and end screencasts. This commit introduces a simple check when the showScreenRecordingUI function is called by the show-screen-recording-ui keybinding. If the showScreenRecordingUI function is called while a screencast is in progress, the stopScreencast function is called instead of opening the screenshot UI in screencast mode. Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5386 Part-of: --- js/ui/screenshot.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 2e6b2cf4f..60dedd68b 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -1428,7 +1428,12 @@ export const ScreenshotUI = GObject.registerClass({ new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}), Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, restrictedModes, - showScreenRecordingUI + () => { + if (this._screencastInProgress) + this.stopScreencast(); + else + showScreenRecordingUI(); + } ); Main.wm.addKeybinding( -- 2.39.5